/* 基础样式 */
body {
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
  color: #4a4a4a;
  margin: 0;
  padding: 20px;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  min-height: 100vh;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
    border-radius: 0;
  }
  
  h1 {
    font-size: 2rem;
    margin-bottom: 20px;
  }
  
  .timer-display {
    font-size: 3rem;
    padding: 15px;
  }
  
  .controls {
    flex-direction: column;
    gap: 10px;
  }
  
  .btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
  }
  
  .custom-time {
    flex-direction: column;
    gap: 10px;
  }
  
  #custom-time {
    width: 100%;
    margin-right: 0;
  }
  
  .timer-controls {
    flex-direction: column;
    gap: 10px;
  }
  
  .medal-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
  }
  
  .medal {
    width: 40px;
    height: 40px;
    font-size: 0.8rem;
  }
  
  .notification {
    width: 90%;
    right: 5%;
    bottom: 10px;
    padding: 15px;
  }
}

h1 {
  color: #ff6f61;
  margin-bottom: 30px;
  font-size: 2.5rem;
  text-shadow: 2px 2px 0px #fff;
}

/* 计时器显示 */
.timer-display {
  font-size: 5rem;
  font-weight: bold;
  margin: 20px 0;
  color: #ff6f61;
  text-shadow: 2px 2px 0px #fff;
  background: #fff;
  padding: 20px;
  border-radius: 20px;
  display: inline-block;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* 控制按钮 */
.controls {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.btn {
  background-color: #ff6f61;
  color: white;
  border: none;
  padding: 15px 30px;
  margin: 5px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.95);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.5s;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.btn:hover::before {
  left: 100%;
}

/* 自定义时间输入 */
.custom-time {
  margin: 20px 0;
}

#custom-time {
  padding: 10px;
  width: 200px;
  margin-right: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

#custom-time:focus {
  outline: none;
  border-color: #ff6f61;
  box-shadow: 0 0 0 2px rgba(255, 111, 97, 0.2);
}

#start-btn {
  background-color: #2ecc71;
  padding: 10px 30px;
}

#start-btn:hover {
  background-color: #27ae60;
}

/* 计时器控制按钮 */
.timer-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}

#fast-forward,
#pause-btn,
#resume-btn {
  background-color: #e67e22;
  padding: 10px 20px;
  border: none;
  border-radius: 15px;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
}

#pause-btn {
  background-color: #3498db;
}

#resume-btn {
  background-color: #2ecc71;
}

#fast-forward:hover {
  background-color: #d35400;
}

#pause-btn:hover {
  background-color: #2980b9;
}

#resume-btn:hover {
  background-color: #27ae60;
}

/* 勋章墙 */
.medals {
  margin-top: 40px;
  background: #fff;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.medal-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 15px;
  margin-top: 20px;
}

.medal {
  background-color: #ffd166;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  opacity: 0.3;
  position: relative;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

.medal:active {
  transform: scale(0.95);
}

.medal.earned:hover::after {
  animation: none;
  transform: translateY(-10px);
}

.medal.earned {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 209, 102, 0.8);
  animation: pop 0.3s ease-out;
}

.medal.earned::after {
  content: '🎉';
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 1.5rem;
  animation: float 2s ease-in-out infinite;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1.1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* 通知样式 */
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #ff6f61;
  color: white;
  padding: 20px 30px;
  border-radius: 20px;
  animation: slideIn 0.5s ease-out;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 2px solid #fff;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification-content {
  display: flex;
  align-items: center;
  position: relative;
}

.notification-icon {
  font-size: 2rem;
  margin-right: 15px;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.notification-text {
  text-align: left;
}

.notification-title {
  font-weight: bold;
  font-size: 1.2rem;
}

.notification-subtitle {
  font-size: 1rem;
  opacity: 0.9;
}

.notification::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 20px;
  width: 20px;
  height: 20px;
  background: #ff6f61;
  transform: rotate(45deg);
  z-index: -1;
}
